﻿using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
using GFramework;
using Holoville.HOTween;

public class DUtil
{
	public static int minCandyMix = 3;
	public static string LevelText = "LV";
	public static float minTimeAppear = 0.750f;
	public static float speedMoveSG = 0.5f;

	public static bool TwoSugarMoveData(Sugar sugar1, Sugar sugar2)
	{
		if ((sugar1 != null) && (sugar2 != null) && (sugar1 != sugar2))
		{
			int col1 = sugar1.col;
			int row1 = sugar1.row;
			int col2 = sugar2.col;
			int row2 = sugar2.row;
			sugar1.SetIndex(col2, row2);
			sugar2.SetIndex(col1, row1);
			return true;
		}
		return false;
	}



	public static ColorSugar RandomColorSugar()
	{
		int ran = UnityEngine.Random.Range(0, 6);
		switch (ran)
		{
			case 0:
				return ColorSugar.Blue;
				break;
			case 1:
				return ColorSugar.Green;
				break;
			case 2:
				return ColorSugar.Orange;
				break;
			case 3:
				return ColorSugar.Purple;
				break;
			case 4:
				return ColorSugar.Red;
				break;
			case 5:
				return ColorSugar.Yellow;
				break;
			case 6:
				Debug.Log("DDDDDDDDDDDDDDDDD");
				break;
		}
		return ColorSugar.Yellow;
	}
}
